﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CourseUtils;

namespace MaxAndMidDivider
{
    class Program
    {
        static void Main(string[] args)
        {
            int value =IOHelpers.ReadIntFromConsole("Enter your number",0,10000);
            FindingPrintMinAndMaxDivider(value);
            Console.ReadKey();
        }

        static void FindingPrintMinAndMaxDivider(int value)
        {
            int minVal = 0;
            int maxVal = 0;
            for (int i = 2; i < value; i++)
            {
                if (value % i == 0) maxVal = i;
            }
            for (int i = value - 1; i > 1; i--)
            {
                if (value % i == 0) minVal = i;
            }
            Console.WriteLine("Min divider: {0} \n Max divider: {1}", minVal, maxVal);
        }
    }
}
